/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ro.futurefeed.model;

import ro.futurefeed.api.FeedType;
import ro.futurefeed.api.FeedStatus;
import com.google.appengine.api.datastore.Key;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author Georgian
 */
@Entity
public class Feed implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    private String fbId;
    
    private FeedStatus status = FeedStatus.WAITING;
    private String content;
    private String dateGMT; // yyyy-MM-dd HH:mm
    private Byte timezone = 0;
    
    private FeedType type = FeedType.WALL;
    
    private String destination;
    private String destinationDescription;
    
    private Boolean sendNotification = true;
    
    private Key userKey;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Key getUserKey() {
        return userKey;
    }

    public void setUserKey(Key userKey) {
        this.userKey = userKey;
    }   

    public String getFbId() {
        return fbId;
    }

    public void setFbId(String fbId) {
        this.fbId = fbId;
    }

    public FeedStatus getStatus() {
        return status;
    }

    public void setStatus(FeedStatus status) {
        this.status = status;
    }    
    
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDateGMT() {
        return dateGMT;
    }

    public void setDateGMT(String dateGMT) {
        this.dateGMT = dateGMT;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getDestinationDescription() {
        return destinationDescription;
    }

    public void setDestinationDescription(String destinationDescription) {
        this.destinationDescription = destinationDescription;
    }

    public Boolean getSendNotification() {
        return sendNotification;
    }

    public void setSendNotification(Boolean sendNotification) {
        this.sendNotification = sendNotification;
    }

    public Byte getTimezone() {
        return timezone;
    }

    public void setTimezone(Byte timezone) {
        this.timezone = timezone;
    }

    public FeedType getType() {
        return type;
    }

    public void setType(FeedType type) {
        this.type = type;
    }

    
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Feed other = (Feed) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.fbId == null) ? (other.fbId != null) : !this.fbId.equals(other.fbId)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 41 * hash + (this.fbId != null ? this.fbId.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Feed{" + "id=" + id + ", content=" + content + ", dateGMT=" + dateGMT + ", timezone=" + timezone + ", type=" + type + ", destination=" + destination + ", destinationDescription=" + destinationDescription + ", sendNotification=" + sendNotification + ", userKey=" + userKey + '}';
    }
}
